package com.ly.heart.service.impl;

import java.util.Collections;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.heart.domain.dto.KingCheckQueryDto;
import com.ly.heart.domain.dto.KingReceiveNoticeMaterialQueryDto;
import com.ly.heart.domain.vo.KingCheckVo;
import com.ly.heart.mapper.KingCheckMaterialMapper;
import com.ly.heart.service.IKingCheckMaterialService;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.KingCheckMaterialEntity;

import javax.annotation.Resource;

/**
 * 金蝶-检验单分录信息（物料信息）Service业务层处理
 *
 * @author cxl
 * @date 2024-08-11
 */
@Service
public class KingCheckMaterialServiceImpl extends ServiceImpl<KingCheckMaterialMapper,KingCheckMaterialEntity> implements IKingCheckMaterialService {

    @Resource
    private KingCheckMaterialMapper kingCheckMaterialMapper;

    @Override
    public List<KingCheckVo> getKingCheckMaterialList(KingCheckQueryDto queryDto) {
        return kingCheckMaterialMapper.getKingCheckMaterialList(queryDto);
    }

    /**
     * 查询金蝶-检验单分录信息（物料信息）
     * @param id 金蝶-检验单分录信息（物料信息）ID
     * @return 金蝶-检验单分录信息（物料信息）
     */
    @Override
    public KingCheckMaterialEntity selectKingCheckMaterialEntityById(String id)
    {
        return kingCheckMaterialMapper.selectKingCheckMaterialEntityById(id);
    }

    /**
     * 查询金蝶-检验单分录信息（物料信息）列表
     * @param kingCheckMaterialEntity 金蝶-检验单分录信息（物料信息）
     * @return 金蝶-检验单分录信息（物料信息）
     */
    @Override
    public List<KingCheckMaterialEntity> selectKingCheckMaterialEntityList(KingCheckMaterialEntity kingCheckMaterialEntity)
    {
        return kingCheckMaterialMapper.selectKingCheckMaterialEntityList(kingCheckMaterialEntity);
    }

    /**
     * 新增金蝶-检验单分录信息（物料信息）
     * @param kingCheckMaterialEntity 金蝶-检验单分录信息（物料信息）
     * @return 结果
     */
    @Override
    public int insertKingCheckMaterialEntity(KingCheckMaterialEntity kingCheckMaterialEntity)
    {
        kingCheckMaterialEntity.setCreateTime(DateUtils.getNowDate());
        return kingCheckMaterialMapper.insertKingCheckMaterialEntity(kingCheckMaterialEntity);
    }

    /**
     * 修改金蝶-检验单分录信息（物料信息）
     * @param kingCheckMaterialEntity 金蝶-检验单分录信息（物料信息）
     * @return 结果
     */
    @Override
    public int updateKingCheckMaterialEntity(KingCheckMaterialEntity kingCheckMaterialEntity)
    {
        return kingCheckMaterialMapper.updateKingCheckMaterialEntity(kingCheckMaterialEntity);
    }

    /**
     * 批量删除金蝶-检验单分录信息（物料信息）
     * @param ids 需要删除的金蝶-检验单分录信息（物料信息）ID
     * @return 结果
     */
    @Override
    public int deleteKingCheckMaterialEntityByIds(String[] ids)
    {
        return kingCheckMaterialMapper.deleteKingCheckMaterialEntityByIds(ids);
    }

    /**
     * 删除金蝶-检验单分录信息（物料信息）信息
     * @param id 金蝶-检验单分录信息（物料信息）ID
     * @return 结果
     */
    @Override
    public int deleteKingCheckMaterialEntityById(String id)
    {
        return kingCheckMaterialMapper.deleteKingCheckMaterialEntityById(id);
    }


    @Override
    public String getTotalCheckNumByReceiveNotice(KingReceiveNoticeMaterialQueryDto materialQueryDto) {
        return kingCheckMaterialMapper.getTotalCheckNumByReceiveNotice(materialQueryDto);
    }

    @Override
    public String getTotalQualifiedNumByReceiveNotice(KingReceiveNoticeMaterialQueryDto materialQueryDto) {
        return kingCheckMaterialMapper.getTotalQualifiedNumByReceiveNotice(materialQueryDto);
    }

    @Override
    public List<KingCheckMaterialEntity> getKingCheckMaterialListByReceiveNotice(KingReceiveNoticeMaterialQueryDto materialQueryDto) {
        return kingCheckMaterialMapper.getKingCheckMaterialListByReceiveNotice(materialQueryDto);
    }
}
